<template>
  <div class="app-container">
<select id="selected_device" @change="onDeviceSelected($event.target)" v-show="false" ></select>
<!-- <br/>
  <input type="button" value="Get Application Configuration" @click="getConfig()"><br/><br/>
<input type="button" value="Send Config Label" @click="writeToSelectedPrinter('~wc')"><br/><br/>
<input type="button" value="Send ZPL Label" @click="writeToSelectedPrinter('^XA^FO200,200^A0N36,36^FDTest Label^FS^XZ')"><br/><br/>
<input type="button" value="Get Status" @click="writeToSelectedPrinter('~hs'); readFromSelectedPrinter()"><br/><br/>
<input type="button" value="Get Local Devices" @click="getLocalDevices(getDeviceCallback, errorCallback);"><br/><br/>
<input type="text" name="write_text" id="write_text"><input type="button" value="Write" @click="writeToSelectedPrinter(document.getElementById('write_text').value)"><br/><br/>
<input type="button" value="Read" @click="readFromSelectedPrinter()"><br/><br/>
<input type="button" value="Send BMP" @click="sendImage('Zebra_logobox.bmp');"><br/><br/>
<input type="button" value="Send JPG" @click="sendImage('ZebraGray.jpg');"><br/><br/>
<input type="button" value="Send File" @click="sendFile('wc.zpl');"><br/><br/>--> 
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="箱体码" prop="packCode">
        <el-input
          v-model="queryParams.packCode"
          placeholder="请输入箱体码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订单号" prop="orderNumber">
        <el-input
          v-model="queryParams.orderNumber"
          placeholder="请输入订单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品编码" prop="partIdentifier">
        <el-input
          v-model="queryParams.partIdentifier"
          placeholder="请输入产品编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['order:package:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['order:package:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['order:package:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['order:package:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="packageList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="箱体标识" align="center" prop="packId" v-if="false"/>
      <el-table-column label="箱体码" align="center" prop="packCode" />
      <el-table-column label="订单号" align="center" prop="orderNumber" />
      <el-table-column label="装箱备注" align="center" prop="comments" />
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.package_status" :value="scope.row.status" />
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="160">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="sendData2Mes(scope.row)"
          >发送数据</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="printZpl()"
            v-hasPermi="['order:package:edit']"
          >打印</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['order:package:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['order:package:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改产品装箱对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="箱体码" prop="packCode">
          <el-input v-model="form.packCode" placeholder="请输入箱体码" />
        </el-form-item>
        <el-form-item label="订单号" prop="orderNumber" v-if="false">
          <el-input v-model="form.orderNumber" placeholder="请输入订单号" />
        </el-form-item>

        <!-- 替换产品编码输入框部分代码为以下内容 -->
        <el-form-item label="产品编码">
          <div style="margin-top: 18px;">
            <el-row :gutter="10" v-for="(row, rowIndex) in getPartIdentifierRows()" :key="rowIndex" style="margin-bottom: 10px;">
              <template v-for="(colIndex) in [0, 1]">
                <el-col :span="11" :key="rowIndex + '-' + colIndex" v-if="rowIndex * 2 + colIndex < form.partIdentifiers.length">
                  <el-row :gutter="10">
                    <el-col :span="3">
                      <div style="line-height: 32px; text-align: right;">{{ rowIndex * 2 + colIndex + 1 }}.</div>
                    </el-col>
                    <el-col :span="18">
                      <el-input 
                        v-model="form.partIdentifiers[rowIndex * 2 + colIndex]" 
                        placeholder="请输入产品编码" 
                        @keyup.enter.native="handlePartIdentifierEnter(rowIndex * 2 + colIndex)"
                        :ref="'partIdentifierInput' + (rowIndex * 2 + colIndex)" />
                    </el-col>
                    <el-col :span="2">
                      <el-button 
                        type="danger" 
                        icon="el-icon-delete" 
                        circle 
                        @click="removePartIdentifier(rowIndex * 2 + colIndex)"
                        size="mini"
                        style="margin-top: 2px;">
                      </el-button>
                    </el-col>
                  </el-row>
                </el-col>
                <!-- 空位占位符 -->
                <el-col :span="11" :key="rowIndex + '-' + colIndex + '-empty'" v-else>
                </el-col>
              </template>
            </el-row>
            
            <el-button 
              type="primary" 
              icon="el-icon-plus" 
              @click="addPartIdentifier" 
              :disabled="form.partIdentifiers.length >= 72">
              添加产品编码
            </el-button>
            <div style="color: #999; font-size: 12px; margin-top: 5px;">
              最多可添加72个产品编码 (当前: {{ form.partIdentifiers.length }} 个)
            </div>
          </div>
        </el-form-item>
        <el-form-item label="装箱备注" prop="comments">
          <el-input v-model="form.comments" placeholder="请输入装箱备注" />
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listPackage, getPackage, delPackage, addPackage, updatePackage,sendPackage } from "@/api/order/package";

export default {
  name: "Package",
  dicts: ['package_status'],
  data() {
    return {
      //打印
      selected_device: null,
      // 打印机列表
      devices: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产品装箱表格数据
      packageList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        packCode: null,
        orderNumber: null,
        partIdentifier: null, // 产品编码
        comments: null,
        creator: null,
        updater: null,
        status: null,
        deleted: null
      },
      // 表单参数
      form: {
        packId: null,
        packCode: null,
        orderNumber: null,
        comments: null,
        partIdentifiers: [] // 多个产品编码
      },
      // 表单校验
      rules: {
        packCode: [
          { required: true, message: "箱体码不能为空", trigger: "blur" }
        ],
        partIdentifiers: [
          { 
            required: true, 
            validator: (rule, value, callback) => {
              if (!value || value.length !== 72) {
                callback(new Error('请添加72个产品编码!'));
              } else if (value.some(item => !item || item.trim() === '')) {
                callback(new Error('产品编码不能为空'));
              } else {
                callback();
              }
            }, 
            trigger: "change" 
          }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  // 在组件挂载后初始化打印机
  mounted() {
    this.setup();
  },
  methods: {
        // 新增方法：获取本地设备列表
    getLocalDevices() {
      BrowserPrint.getLocalDevices(this.getDeviceCallback, this.errorCallback);
    },
    
    /** 查询产品装箱列表 */
    getList() {
      this.loading = true;
      listPackage(this.queryParams).then(response => {
        this.packageList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
  // 计算需要多少行来显示产品编码（每行2个）
    getPartIdentifierRows() {
      const rows = [];
      const rowCount = Math.ceil(this.form.partIdentifiers.length / 2);
      for (let i = 0; i < rowCount; i++) {
        rows.push(i);
      }
      return rows;
    },
    
    // 添加产品编码行
    addPartIdentifier() {
      if (this.form.partIdentifiers.length < 72) {
        this.form.partIdentifiers.push('');
      }
    },
     
    // 处理产品编码输入框回车事件
    handlePartIdentifierEnter(index) {
      // 如果不是最后一个输入框，则聚焦到下一个
      if (index < this.form.partIdentifiers.length - 1) {
        this.$nextTick(() => {
          const nextInput = this.$refs[`partIdentifierInput${index + 1}`];
          if (nextInput && nextInput[0]) {
            nextInput[0].focus();
          }
        });
      } else {
        // 如果是最后一个输入框，则添加一个新的
        if (this.form.partIdentifiers.length < 72) {
          this.addPartIdentifier();
          this.$nextTick(() => {
            const nextInput = this.$refs[`partIdentifierInput${index + 1}`];
            if (nextInput && nextInput[0]) {
              nextInput[0].focus();
            }
          });
        }
      }
    },
  
    // 删除产品编码行
    removePartIdentifier(index) {
      this.form.partIdentifiers.splice(index, 1);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        packId: null,
        packCode: null,
        orderNumber: null,
        comments: null,
        partIdentifiers: [] // 多个产品编码
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.packId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加产品装箱";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const packId = row.packId || this.ids
      getPackage(packId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改产品装箱";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.packId != null) {
            updatePackage(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPackage(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const packIds = row.packId || this.ids;
      this.$modal.confirm('是否确认删除产品装箱编号为"' + packIds + '"的数据项？').then(() => {
        return delPackage(packIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 发送按钮操作 */
    sendData2Mes(row) {
      const packIds = row.packId || this.ids;
      const packCodes = row.packCode || this.packageList.map(item => item.packCode).join(',');
      this.$modal.confirm('是否确认产品装箱编码为"' + packCodes + '"的数据项？').then(() => {
        return sendPackage(packIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("发送成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('order/package/export', {
        ...this.queryParams
      }, `package_${new Date().getTime()}.xlsx`)
    },
    /** 打印按钮操作 */

     setup() {
      //Get the default device from the application as a first step. Discovery takes longer to complete.
      BrowserPrint.getDefaultDevice("printer", (device) => {
        
            //Add device to list of devices and to html select element
            this.selected_device = device;
            this.devices.push(device);
            var html_select = document.getElementById("selected_device");
            var option = document.createElement("option");
            option.text = device.name;
            html_select.add(option);
            
            //Discover any other devices available to the application
            BrowserPrint.getLocalDevices((device_list) =>{
              for(var i = 0; i < device_list.length; i++)
              {
                //Add device to list of devices and to html select element
                var device = device_list[i];
                if(!this.selected_device || device.uid != this.selected_device.uid)
                {
                  this.devices.push(device);
                  var option = document.createElement("option");
                  option.text = device.name;
                  option.value = device.uid;
                  html_select.add(option);
                }
              }
              
            }, () => {alert("Error getting local devices")},"printer");
            
          }, (error) =>{
            alert(error);
          })
    },
    getConfig() {
      BrowserPrint.getApplicationConfiguration((config) => {
        alert(JSON.stringify(config))
      }, (error) =>{
        alert(JSON.stringify(new BrowserPrint.ApplicationConfiguration()));
      })
    },
    printZpl() { 
     var content = "^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2~SD30^JUS^LRN^CI0^XZ\n"+
"^XA\n"+
"^MMT\n"+
"^PW1200\n"+
"^LL0952\n"+
"^LS0\n"+
"^FO352,32^GFA,03584,03584,00056,:Z64:\n"+
"eJzt1kFu4zYUANAvEBhuBuU2i0C8QoBushDoq8wRHGQxKqqOFXjhpS9QpBcJChpeeFPARwgDA/Wy3xBQE4jH7P8kLcvpzAFahAFkSeaTyf8/qQC8t/f2X2xX3/viQ/4c099FUy2AcOXp8iNc01FaOiDEs3gODRzibe4em4xO05mnT7pfXTjVJld/25Unp8Hkm72LPX1yXoEIIdj0aOFM7Bdd2btROIIO8+D4ojgOnaTDkfrT4K7GS3IlO77bntxv7Irk2kvXuQaguttPXRzlyVV0NUpOOLFmhypPr2gpBa9uEry52y4dVERcdjGOaG7pQ1i5bodOWgpl50Lw5f1yc3Itxy06j00KsJzZoRO2zE7fLzpHeUphyU6g91UMq6LJD8dpaUbdy/7Rq88Pr0M3itFGvOUp61stcOB04OiEr1tyk5YicOjjEl3hhOUaVMYUh7duEcL2EeEz/PwvR+ecPfjQNBBg/2s3H7rNdkVuDD+64jAKIY2zwFS/6eMXftT+aT+HcytOjrI0dDEb2sc+ryE8Q3QTun3IbjMvcRLW7Pq4ZDeKkYKdq3+A/WO3zo6OKDZOGXLPUyfP88vuyyg+GmlFFG/dkl29Wy+dfOqd+JtTVBy0jXlkt33c/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nN2DRK5HOyzqA/xWGbn07NysPK3ezWMmHPWtW0UNSn3P98M2nGGu6WnsxSOT79MN3Mby0DZ2uEveJsi/5InmNZ28JqguXlzJ0IbSda0cuj8ymK4+XCXYpWSkRYrdap5rF+1auuaayoZR9trdI+y7Vwd9ty530MtFFoY+bO21vb+a3VzO92eQFe2/sv6Gc7cuTID/kG5DrDnA==:8F2A\n"+
"^FO320,672^GFA,01792,01792,00028,:Z64:\n"+
"eJzt0j2O2zAQBeDHMAhTiRcwpGuoIKwrsWRhYEfYItfiYi/CVGlZujA0ebT14+QAW3kAU6A/yh7ODPCKV3xN+CsmsQumBW9wVwzZLJsNN2h2irfFqHgeKNyswfNavEqzPPBM5Wa1S29KHZxE2I8SPGoaXF6teptj4AdOSnJzGXl4teKtpNHmCoca7ZxD2MwU52RMJhd4xGjf8ylgew/N8K/Vw/Cwjube5TQe5h0CbP4jHVKi9ePxm93dZq20wMSerW/mZr3SpjNtzxM4eZzgTL30GP3NSfdkoZk3OWzW260uSM16Iz1tWmiD/8+YE+08/JLuqDULSgsPS47mdmPRKIn3ZJ7RfkqPvX82N6sPq3fze8mENWtZ02I1n3L/892kGXO4W34yT2X77MNss7CXDOytE9aKva32Iwe2ZSsLs4mey5kzEdtMtKTXq/MWtedy4SwlLzUhbqY6a5n0t16t5kmh9WitqrTvilbObhvucrSBNgltKpx5f2szv5ea8b0tP4Cf7fkN9tle8QXxF31ww5w=:520D\n"+
"^FO48,15^GB1144,918,6^FS\n"+
"^FO52,114^GB1138,0,6^FS\n"+
"^FO52,212^GB1136,0,6^FS\n"+
"^FO52,308^GB598,0,6^FS\n"+
"^FO48,403^GB1139,0,6^FS\n"+
"^FO48,498^GB1139,0,6^FS\n"+
"^FO48,583^GB1139,0,6^FS\n"+
"^FO336,119^GB0,808,6^FS\n"+
"^FO650,114^GB0,472,6^FS\n"+
"^FO911,114^GB0,819,6^FS\n"+
"^FO917,311^GB275,0,6^FS\n"+
"^FO52,665^GB859,0,6^FS\n"+
"^FO52,747^GB859,0,6^FS\n"+
"^FO54,833^GB857,0,6^FS\n"+
"^PQ1,0,1,Y^XZ\n";
     this.writeToSelectedPrinter(content);
    },
    writeToSelectedPrinter(dataToWrite) {
      this.selected_device.send(dataToWrite, undefined, this.errorCallback);
    },
    readCallback(readData) {
      if(readData === undefined || readData === null || readData === "")
      {
        alert("No Response from Device");
      }
      else
      {
        alert(readData);
      }
      
    },
    errorCallback(errorMessage){
      alert("Error: " + errorMessage);	
    },
    readFromSelectedPrinter() {
      this.selected_device.read(this.readCallback, this.errorCallback);
    },
    getDeviceCallback(deviceList) {
      alert("Devices: \n" + JSON.stringify(deviceList, null, 4))
    },

    sendImage(imageUrl) {
      url = window.location.href.substring(0, window.location.href.lastIndexOf("/"));
      url = url + "/" + imageUrl;
      this.selected_device.convertAndSendFile(url, undefined, this.errorCallback)
    },
    sendFile(fileUrl){
        url = window.location.href.substring(0, window.location.href.lastIndexOf("/"));
        url = url + "/" + fileUrl;
        this.selected_device.sendFile(url, undefined, this.errorCallback)
    },
    onDeviceSelected(selected) {
      for(var i = 0; i < this.devices.length; ++i){
        if(selected.value == this.devices[i].uid)
        {
          this.selected_device = this.devices[i];
          return;
        }
      }
    }
  }
};
</script>